{
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.2"
  },
  "orig_nbformat": 2,
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3",
   "language": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2,
 "cells": [
  {
   "source": [
    "# 类型检查"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "## 数据类型\n",
    "\n",
    "1. 数值\n",
    "    - 整型\n",
    "        - 布尔值\n",
    "    - 浮点型\n",
    "    - 负数\n",
    "2. 字符串\n",
    "3. 空值"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "## 类型检查\n",
    "\n",
    "通过类型检查，检查变量的类型\n",
    "\n",
    "###  `type()` \n",
    "\n",
    "`type()`　会将检查的结果作为返回值返回"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = '123'\n",
    "b = 123\n",
    "c = 1.5\n",
    "d = True\n",
    "e = None\n",
    "rst1 = type(a)\n",
    "rst2 = type(b)\n",
    "rst3 = type(c)\n",
    "rst4 = type(d)\n",
    "rst5 = type(e)\n",
    "rst6 = type(rst1)\n",
    "print(a, rst1)\n",
    "print(b, rst2)\n",
    "print(c, rst3)\n",
    "print(d, rst4)\n",
    "print(e, rst5)\n",
    "print(rst6)"
   ]
  }
 ]
}